home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / linux / src / atalnx_3.lzh / atari-linux-0.01pl3 / atari / ataints.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-16  |  3.1 KB  |  114 lines

  1. /*
  2.  * ataints.c -- atari Linux interrupt handling code
  3.  *
  4.  * 5/2/94 Roman Hodek:
  5.  *  Added support for TT interrupts; setup for TT SCU (may someone has
  6.  *  twiddled there and we won't get the right interrupts :-()
  7.  *
  8.  *  Major change: The device-independant code in m68k/ints.c didn't know
  9.  *  about non-autovec ints yet. It hardcoded the number of possible ints to
  10.  *  7 (IRQ1...IRQ7). But the Atari has lots of non-autovec ints! I made the
  11.  *  number of possible ints a constant defined in interrupt.h, which is
  12.  *  47 for the Atari. So we can call add_isr() for all Atari interrupts just
  13.  *  the normal way. Additionally, all vectors >= 48 are initialized to call
  14.  *  trap() instead of inthandler(). This must be changed here, too.
  15.  *
  16.  * This file is subject to the terms and conditions of the GNU General Public
  17.  * License.  See the file README.legal in the main directory of this archive
  18.  * for more details.
  19.  *
  20.  */
  21.  
  22. #include <linux/types.h>
  23. #include <linux/config.h>
  24. #include <linux/interrupt.h>
  25. #include <linux/kernel.h>
  26. #include <linux/traps.h>
  27.  
  28. #include <asm/system.h>
  29.  
  30. #include <linux/atarihw.h>
  31. #include <linux/atariints.h>
  32. #include <linux/atari_stdma.h>
  33. #include <linux/bootinfo.h>
  34.  
  35. /*
  36.  * void atari_init_INTS (void)
  37.  *
  38.  * Parameters:    None
  39.  *
  40.  * Returns:    Nothing
  41.  *
  42.  * This function should be called during kernel startup to initialize
  43.  * the atari IRQ handling routines.
  44.  */
  45.  
  46.  
  47. asmlinkage void inthandler(void);
  48. extern void atari_microwire_cmd( int cmd );
  49.  
  50.  
  51. extern e_vector    vectors[];
  52.  
  53.  
  54. void atari_init_INTS (void)
  55.  
  56. {    int        i;
  57.     
  58.     /* The device independant code sets all exception vectors >= 48 to 'trap',
  59.      * not 'inthandler'. On the Atari, vectors 64..111 are used for
  60.      * non-autovector ints, so we they should jump to the inthandler!
  61.      */
  62.  
  63.     for( i = 48; i < 112; ++i )
  64.         vectors[i] = inthandler;
  65.  
  66.     /* All ints are initialized to do nothing by the device independant code
  67.        -- no work here */
  68.     
  69.     /* Initialize the MFP(s) */
  70.     
  71.     mfp.vec_adr  = 0x40;    /* Automatic EOI-Mode */
  72.     mfp.int_en_a =            /* turn off MFP-Ints */
  73.     mfp.int_en_b = 0x00;
  74.     mfp.int_mk_a =            /* no Masking */
  75.     mfp.int_mk_b = 0xff;
  76.  
  77.     if (boot_info.bi_atari.model == ATARI_TT) {
  78.         tt_mfp.vec_adr  = 0x50;        /* Automatic EOI-Mode */
  79.         tt_mfp.int_en_a =            /* turn off MFP-Ints */
  80.         tt_mfp.int_en_b = 0x00;
  81.         tt_mfp.int_mk_a =            /* no Masking */
  82.         tt_mfp.int_mk_b = 0xff;
  83.  
  84.         /* For a TT, init the SCU */
  85.         tt_scu.sys_mask = 0x10;        /* enable VBL (for the cursor) and
  86.                                      * disable HSYNC interrupts (how
  87.                                      * needs them?)  MFP and SCC are
  88.                                      * enabled in VME mask
  89.                                      */
  90.         tt_scu.vme_mask = 0x60;        /* enable MFP and SCC ints */
  91.  
  92.         /* Initialize the LM1992 Sound Controller to enable the PSG sound.
  93.          * This is misplaced here, it should be in a atasound_init(),
  94.          * that doesn't exist yet.
  95.          */
  96.         atari_microwire_cmd( MW_LM1992_PSG_HIGH );
  97.     }
  98.     
  99.     stdma_init();
  100.  
  101.     /* Initialize the PSG: all sounds off, both ports output */
  102.     sound_ym.rd_data_reg_sel = 7;
  103.     sound_ym.wd_data = 0xff;
  104. }
  105.  
  106.  
  107. /* dummy mach_add_isr(), we don't need one */
  108.  
  109. int atari_add_isr( unsigned long source , isrfunc isr , int pri , void *data )
  110.  
  111. {
  112.     return( 0 );
  113. }
  114.